<?xml version="1.0" encoding="UTF-8"?>
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
   xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
   xmlns:f="http://xmlns.jcp.org/jsf/core"
   xmlns:h="http://xmlns.jcp.org/jsf/html"
   xmlns:p="http://primefaces.org/ui"
   xmlns:c="http://xmlns.jcp.org/jsp/jstl/core"
   template="/WEB-INF/templates/default.xhtml">
   
    <f:metadata>
	   	<f:viewParam name="professionUserId" value="#{professionUserHome.id}"></f:viewParam>	   	
	   	<f:event listener="#{professionUserHome.initConversation()}" type="preRenderView"></f:event>
	   	<f:viewParam name="moduleName" value="行业部门用户管理"></f:viewParam>
   	</f:metadata>
   
    <ui:define name="content">
   
	   <h:form id="editForm">         
	        <p:messages id="messages" closable="true">
	       		<p:autoUpdate />
	       	</p:messages>
   			<p:panel id="baseInfo" header="#{professionUserHome.managed ? '修改' : '新增'}资质审核人员" style="margin-bottom:10px;">		        
		        <h:panelGrid columns="2" cellpadding="5">
		        	<p:outputLabel for="username" value="山东政务服务门户网站登录名" />
					<p:inputText id="username" value="#{professionUserHome.instance.username}"
						   required="true"
						   readonly="#{professionUserHome.managed}"> 
						<f:validator binding="#{usernameValidator}"></f:validator>
						<f:ajax render="@this" />		  
					</p:inputText>
					
					<p:outputLabel for="cnname" value="姓名" />				
					<p:inputText id="cnname" value="#{professionUserHome.instance.cnname}"
						   required="true"
						   readonly="#{professionUserHome.managed}">	  
					</p:inputText>
					<c:if test="#{not professionUserHome.managed}">
						<p:outputLabel for="email" value="邮箱" />				
						<p:inputText id="email" 
								  value="#{professionUserHome.instance.email}" 
							   required="true">
							<f:validator binding="#{emailValidator}"></f:validator>
							<f:ajax render="@this"/>
						</p:inputText>
					</c:if>
					<p:outputLabel
							for="region"
							value="所属县区"
					/>
					<p:selectOneMenu id="region"
									 value="#{professionUserHome.instance.region}"
									 required="true">
						<f:selectItem itemLabel="请选择" itemValue="#{null}"  />
						<f:selectItems value="#{codeDicUtils.getCodeDicList('所在地区')}" var="_codeDic" itemValue="#{_codeDic.codeValue}"
									   itemLabel="#{_codeDic.codeName}" />
					</p:selectOneMenu>
					<p:outputLabel for="serviceDepartment" value="主管部门"></p:outputLabel>
					<p:selectOneMenu id="serviceDepartment"
								  value="#{professionUserHome.instance.serviceDepartment}"
							   required="true">
						<f:selectItem itemLabel="请选择" itemValue="#{null}" />		
						<f:selectItems value="#{serviceDepartmentList.resultList}" var="_dept" itemLabel="#{_dept.cnname}" itemValue="#{_dept}"></f:selectItems>
						<f:converter converterId="entityConverter"></f:converter>						
					</p:selectOneMenu>	 
				</h:panelGrid>
			</p:panel>
			
   			<p:commandButton action="#{professionUserHome.saveAndFlush()}" value="保存" ajax="true" />
   			<p:commandButton action="#{professionUserHome.delete()}" value="删除" ajax="true" />
			<p:commandButton action="#{professionUserHome.cancel()}" value="取消" immediate="true"></p:commandButton>
	
	   	</h:form>
   </ui:define>
   
</ui:composition>
